#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;

//and.cpp
//const int ArSize = 6;
//
//int main()
//{
//	float naaq[ArSize];
//	cout << "Enter the NAAQs( New Age Awareness Quotients)"
//		<< " of\nyour neighbors. Program terminates "
//		<< "when you make\n" << ArSize << " entries "
//		<< "or enter a nagative value.\n";
//
//	int i = 0;
//	float temp;
//	cout << "First value:";
//	cin >> temp;
//	while (i < ArSize && temp >= 0)
//	{
//		naaq[i] = temp;
//		++i;
//		if (i < ArSize)
//		{
//			cout << "Next value:";
//			cin >> temp;
//		}
//	}
//	if (i == 0)
//		cout << "No date--bye\n";
//	else
//	{
//		cout << "Enter your NAAQ: ";
//		float you;
//		int count = 0;
//		cin >> you;
//		for (int j = 0; j < i; j++)
//			if (naaq[j] > you)
//				++count;
//		cout << count;
//		cout << "of your neighbors have greater awareness of\n"
//			<< "the New Age than you do.\n";
//	}
//
//	return 0;
//}



//cctypes.cpp
//#include<cctype>
//
//int main()
//{
//	cout << "Enter text for analysis, and type @ to terminate input.\n";
//
//	char ch;
//	int whitespace = 0;
//	int digits = 0;
//	int punct = 0;
//	int chars = 0;
//	int others = 0;
//
//	cin.get(ch);
//	while (ch != '@')
//	{
//		if (isalpha(ch))
//			chars++;
//		else if (isspace(ch))
//			whitespace++;
//		else if (isdigit(ch))
//			digits++;
//		else if (ispunct(ch))
//			punct++;
//		else
//			others++;
//		cin.get(ch);
//	}
//	cout << chars << " letters, "
//		<< whitespace << " whitespace, "
//		<< digits << " digits, "
//		<< punct << " punctuation, "
//		<< others << " others\n";
//
//	return 0;
//}



//switch.cpp
//void show_menu();
//void report();
//void comfort();
//int main()
//{
//	show_menu();
//	int choice;
//	cin >> choice;
//	while (choice != 5)
//	{
//		switch (choice)
//		{
//		case 1:cout << "\a\n";
//			break;
//		case 2: report();
//			break;
//		case 3: cout << "The boss was in all day.\n";
//			break;
//		case 4: comfort();
//			break;
//		default: cout << "That's not a choice.\n";
//		}
//		show_menu();
//		cin >> choice;
//	}
//	cout << "Bye!\n";
//	return 0;
//}
//
//void show_menu()
//{
//	cout << "Please enter 1, 2, 3, 4, or 5:\n"
//		"1) alarm                2) report\n"
//		"3) alibi                4) comfort\n"
//		"5) quit\n";
//}
//
//void report()
//{
//	cout << "It's a been an excellent week for business.\n"
//		"Sales are up 120%. Expenses are down 35%.\n";
//}
//
//void comfort()
//{
//	cout << "You employees think you are the finest CEO\n"
//		<< "in the industry. The board of directions think\n"
//		<< "you are the finest CEO in the industry.\n";
//}



//enum.cpp
//enum
//{
//	red, orange, yellow, green, blue, violet, indigo
//};
//
//int main()
//{
//	cout << "Enter color code(0 - 6): ";
//	int code;
//	cin >> code;
//	while (code >= red && code <= indigo)
//	{
//		switch (code)
//		{
//		case red:
//			cout << "Her lips were red.\n"; break;
//		case orange:
//			cout << "Her hair was orange.\n"; break;
//		case yellow:
//			cout << "Her shoes were yellow.\n"; break;
//		case green:
//			cout << "Her nails was green.\n"; break;
//		case blue:
//			cout << "Her sweatsuit was blue.\n"; break;
//		case violet:
//			cout << "Her eyes were violet.\n"; break;
//		case indigo:
//			cout << "her mood was indigo.\n"; break;
//		}
//		cout << "Enter color code(0 - 6): ";
//		cin >> code;
//			
//	}
//	cout << "Bye\n";
//
//	return 0;
//}



//cingolf.cpp
//const int Max = 5;
//int main()
//{
//	int golf[Max];
//	cout << "Please enter your golf scores.\n";
//	cout << "You must enter " << Max << " rounds.\n";
//	int i;
//	for (i = 0; i < Max; i++)
//	{
//		cout << "Roud #" << i + 1 << " :";
//		while (!(cin >> golf[i]))
//		{
//			cin.clear();
//			while (cin.get() != '\n')
//				continue;
//			cout << "Please enter a number:";
//		}
//	}
//	double total = 0.0;
//	for (i = 0; i < Max; i++)
//	total += golf[i];
//	cout << total / Max << " = average score "
//		<< Max << " rounds\n";
//
//	return 0;
//}



//outfile.cpp
//#include<fstream>
//
//int main()
//{
//	char automobile[50];
//	int year;
//	double a_price;
//	double d_price;
//
//	ofstream outFile;
//	outFile.open("carinfo.txt");
//
//	cout << "Enter the make and model of automobile: ";
//	cin.getline(automobile, 50);
//	cout << "Enter the model year: ";
//	cin >> year;
//	cout << "Enter the original asking price: ";
//	cin >> a_price;
//	d_price = 0.913 * a_price;
//
//	cout << fixed;
//	cout.precision(2);
//	cout.setf(ios_base::showpoint);
//	cout << "Make and model: " << automobile << endl;
//	cout << "Year: " << year << endl;
//	cout << "Was asking $" << a_price << endl;
//	cout << "Now asking $" << d_price << endl;
//
//	outFile << fixed;
//	outFile.precision(2);
//	outFile.setf(ios_base::showpoint);
//	outFile << "Make and model: " << automobile << endl;
//	outFile << "Year: " << year << endl;
//	outFile << "Was asking $" << a_price << endl;
//	outFile << "Now asking $" << d_price << endl;
//
//	outFile.close();
//
//	return 0;
//}



//sumafile.cpp
//#include<fstream>
//#include<cstdlib>
//
//const int SIZE = 50;
//
//int main()
//{
//	char filename[SIZE];
//	ifstream infile;
//	cout << "Enter name of date file: ";
//	cin.getline(filename, SIZE);
//	infile.open(filename);
//	if (!infile.is_open())
//	{
//		cout << "Could not open the file " << filename << endl;
//		cout << "Pragram terminating.\n";
//		exit(EXIT_FAILURE);
//	}
//	double value;
//	double sum = 0.0;
//	int count = 0;
//	infile >> value;
//	while (infile.good())
//	{
//		count++;
//		sum += value;
//		infile >> value;
//	}
//	if (infile.eof())
//		cout << "End of file reached.\n";
//	else if (infile.fail())
//		cout << "Input terminated by date mismatch.\n";
//	else
//		cout << "Input terminated for unknown reason.\n";
//	if (count == 0)
//		cout << "No date processed.\n";
//	else
//	{
//		cout << "Item read: " << count << endl;
//		cout << "Sum: " << sum << endl;
//		cout << "Average: " << sum / count << endl;
//	}
//	infile.close();
//
//	return 0;
//}